Skip to content

Fixes bug of missing overload API for XSimpleList<T> for default values for elements of simple types#86

Merged
mamift merged 16 commits intomasterfrom
bug/defaultXTypedList_T_api
Apr 21, 2026
Merged

Fixes bug of missing overload API for XSimpleList<T> for default values for elements of simple types#86
mamift merged 16 commits intomasterfrom
bug/defaultXTypedList_T_api

Conversation

@mamift
Copy link
Copy Markdown
Owner

@mamift mamift commented Apr 20, 2026

  • Fixes a bug whereby the XObjects API (XSimpleList<T>) did not include the requisite overload for allowing default values for elements of simple types.
  • Adds some examples XSDs for attributes and elements with default values.

Copilot AI review requested due to automatic review settings April 20, 2026 11:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to support default values for simple-type element lists by extending XSimpleList<T>/XList<T> APIs, and adds new XSD feature-test schemas plus a small schema-compilation handling tweak.

Changes:

  • Added default-values overloads to XSimpleList<T> and XList<T> initialization paths.
  • Added new XSD feature-test schemas (Attributes + Elements) and a new NUnit test file.
  • Adjusted XmlSchemaSet.Compile() error handling in ToXmlSchemaSet.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
XObjectsTests/XsdFeatureTests/AttributeFeatureTests.cs Adds NUnit tests for list-valued attributes (including defaulted attribute lists).
XObjectsTests/XObjectsTests.csproj Adds a folder entry for the new test directory.
XObjectsCore/Extensions/GeneralExtensionMethods.cs Wraps a specific schema compile error with a LinqToXsdException.
XObjectsCore/API/XSimpleList.cs Adds DefaultValues storage + new Initialize overload accepting defaults.
XObjectsCore/API/XList.cs Adds an overload of InitializeFrom that can apply default values.
LinqToXsd/Properties/launchSettings.json Adds launch profiles for generating feature-test schemas.
LinqToXsd.Schemas/XsdFeatureTests/Elements/ElementsListTypeWithDefaults.xsd(.cs) Adds element list schema + generated code using new XSimpleList defaults API.
LinqToXsd.Schemas/XsdFeatureTests/Elements/ElementsListType.xsd(.cs) Adds element list schema + generated code (non-defaulted).
LinqToXsd.Schemas/XsdFeatureTests/Attributes/ListTypeWithDefaults.xsd(.cs) Adds attribute list schema + generated code (includes defaulted attributes).
LinqToXsd.Schemas/XsdFeatureTests/Attributes/ListType.xsd(.cs) Adds attribute list schema + generated code (non-defaulted).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread XObjectsCore/API/XList.cs Outdated
Comment thread XObjectsCore/API/XSimpleList.cs
Comment thread XObjectsCore/API/XSimpleList.cs Outdated
Comment thread XObjectsCore/Extensions/GeneralExtensionMethods.cs
Comment thread XObjectsCore/API/XSimpleList.cs
@mamift
Copy link
Copy Markdown
Owner Author

mamift commented Apr 21, 2026

@copilot please review changes since last review.

Copy link
Copy Markdown

Copilot AI commented Apr 21, 2026

@copilot please review changes since last review.

Reviewed the updates on this branch and validated them locally and in Actions (no failed workflow jobs found). I don’t see additional code changes needed at this point. Verification was done on commit 77945de.

@mamift mamift self-assigned this Apr 21, 2026
@mamift mamift force-pushed the bug/defaultXTypedList_T_api branch from 77945de to 5b61cae Compare April 21, 2026 08:23
@mamift mamift merged commit e8cde79 into master Apr 21, 2026
7 checks passed
@mamift mamift deleted the bug/defaultXTypedList_T_api branch April 21, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants